"use strict";
cc._RF.push(module, 'c61a5hts05LwoaTFWpJyzno', 'MoveMap');
// Script/MoveMap.js

"use strict";

//实现地图拖拽
cc.Class({
  "extends": cc.Component,
  properties: {},
  // LIFE-CYCLE CALLBACKS:
  // onLoad() {
  // 	let nodeBack = this.node; //地图节点
  // 	var size = this.node.getContentSize();
  // 	let rangeX = cc.winSize.width; //容器可视宽度、这里默认屏幕大小为容器宽度
  // 	let rangeY = cc.winSize.height; //容器可视高度、这里默认屏幕大小为容器高度
  // 	nodeBack.on(cc.Node.EventType.TOUCH_MOVE, function(event) {
  // 		let dir = event.touch.getDelta();
  // 		nodeBack.x += dir.x;
  // 		nodeBack.y += dir.y;
  // 		let zoneLeft = -rangeX / 2;
  // 		let zoneRight = rangeX / 2;
  // 		let zoneTop = rangeY / 2;
  // 		let zoneBottom = -rangeY / 2;
  // 		let halfMapWidth = nodeBack.width / 2;
  // 		let halfMapHeight = nodeBack.height / 2;
  // 		// 最左边
  // 		if (nodeBack.x - halfMapWidth > zoneLeft) {
  // 			nodeBack.x = zoneLeft + halfMapWidth;
  // 		}
  // 		//最右边
  // 		if (nodeBack.x + halfMapWidth < zoneRight) {
  // 			nodeBack.x = zoneRight - halfMapWidth;
  // 		}
  // 		//最上边
  // 		if (nodeBack.y + halfMapHeight < zoneTop) {
  // 			nodeBack.y = zoneTop - halfMapHeight;
  // 		}
  // 		//最下边
  // 		if (nodeBack.y - halfMapHeight > zoneBottom) {
  // 			nodeBack.y = zoneBottom + halfMapHeight;
  // 		}
  // 	}, this);
  // },
  start: function start() {},
  update: function update(dt) {}
});

cc._RF.pop();